//FIGURE A.II - EFFECTS ON CRIMES, HOMICIDES AND ARRESTS
use crimes, clear

reghdfe homicides treat_semester93-treat_semester98 treat_semester100-treat_semester107, absorb(semester#geoid_blkgrp geoid_block) cluster(match_zip)
reghdfe crimes treat_semester93-treat_semester98 treat_semester100-treat_semester107 if semester>=21, absorb(semester#geoid_blkgrp geoid_block) cluster(match_zip)
reghdfe arrests treat_semester93-treat_semester98 treat_semester100-treat_semester107 if semester>=21, absorb(semester#geoid_blkgrp geoid_block) cluster(match_zip)

//FIGURE A.III - EFFECTS ON INTRA-LAUSD TRANSFERS
use transfers, clear

reghdfe share_transfer treat_semester93-treat_semester98 treat_semester100-treat_semester107 [aweight=weight], absorb(school semester#zone) cluster(school)

//FIGURE A.IV - EFFECTS ON GPA: ALTERNATIVE SPECIFICATIONS 
use gpa_semester, clear
reghdfe gpa treat_semester93-treat_semester98 treat_semester100-treat_semester107, absorb(geoid_blkgrp#semester mystd_id cohort#year) cluster(match_zip)
reghdfe gpa treat_semester93-treat_semester98 treat_semester100-treat_semester107 if dist<=1, absorb(geoid_blkgrp#semester mystd_id cohort#year) cluster(match_zip)
reghdfe gpa treat_semester93-treat_semester98 treat_semester100-treat_semester107 if dist<=2, absorb(geoid_blkgrp#semester mystd_id cohort#year) cluster(match_zip)

use gpa_semester_t25, clear
reghdfe gpa treat_semester93-treat_semester98 treat_semester100-treat_semester107, absorb(geoid_blkgrp#semester mystd_id cohort#year) cluster(match_zip)

use gpa_semester_t375, clear
reghdfe gpa treat_semester93-treat_semester98 treat_semester100-treat_semester107, absorb(geoid_blkgrp#semester mystd_id cohort#year) cluster(match_zip)

//FIGURE A.V - EFFECTS ON GPA: HETEROGENEITY ANALYSIS
use gpa_semester, clear

reghdfe gpa treat_post if !male, absorb(geoid_blkgrp#semester mystd_id cohort#year) cluster(match_zip)
reghdfe gpa treat_post if male, absorb(geoid_blkgrp#semester mystd_id cohort#year) cluster(match_zip)
reghdfe gpa treat_post if !freelunch, absorb(geoid_blkgrp#semester mystd_id cohort#year) cluster(match_zip)
reghdfe gpa treat_post if freelunch, absorb(geoid_blkgrp#semester mystd_id cohort#year) cluster(match_zip)
reghdfe gpa treat_post if parent_edu==1, absorb(geoid_blkgrp#semester mystd_id cohort#year) cluster(match_zip)
reghdfe gpa treat_post if parent_edu==2, absorb(geoid_blkgrp#semester mystd_id cohort#year) cluster(match_zip)
reghdfe gpa treat_post if parent_edu==3, absorb(geoid_blkgrp#semester mystd_id cohort#year) cluster(match_zip)
reghdfe gpa treat_post if cst_level==1, absorb(geoid_blkgrp#semester mystd_id cohort#year) cluster(match_zip)
reghdfe gpa treat_post if cst_level==2, absorb(geoid_blkgrp#semester mystd_id cohort#year) cluster(match_zip)
reghdfe gpa treat_post if cst_level==3, absorb(geoid_blkgrp#semester mystd_id cohort#year) cluster(match_zip)
reghdfe gpa treat_post if !media, absorb(geoid_blkgrp#semester mystd_id cohort#year) cluster(match_zip)
reghdfe gpa treat_post if media, absorb(geoid_blkgrp#semester mystd_id cohort#year) cluster(match_zip)

//FIGURE A.VI - EFFECTS ON GPA BY GRADE OF TREATMENT
use gpa_semester, clear

drop treat_semester99

reghdfe gpa treat_semester100-treat_semester107 if (!treat | grade_treat==9), absorb(geoid_blkgrp#semester mystd_id cohort#year) cluster(match_zip)
reghdfe gpa treat_semester97-treat_semester105 if (!treat | grade_treat==10), absorb(geoid_blkgrp#semester mystd_id cohort#year) cluster(match_zip)
reghdfe gpa treat_semester95-treat_semester103 if (!treat | grade_treat==11), absorb(geoid_blkgrp#semester mystd_id cohort#year) cluster(match_zip)
reghdfe gpa treat_semester93-treat_semester101 if (!treat | grade_treat==12), absorb(geoid_blkgrp#semester mystd_id cohort#year) cluster(match_zip)

//FIGURE A.XII: EFFECTS ON GPA BY STUDENT-DECEASED SIMILARITY
use gpa_semester_similarity, clear

reghdfe gpa ib0.tp_similarity if std_blackhispanic, absorb(geoid_blkgrp#semester mystd_id cohort#year) cluster(match_zip)
reghdfe gpa ib0.tp_similarity if std_whiteasian, absorb(geoid_blkgrp#semester mystd_id cohort#year) cluster(match_zip)

//FIGURE A.XIII: EFFECTS ON HS GRADUATION: DROPOUTS VS. TRANSFERS
use longrun, clear

local controls = "school treat expected_grade cst_level poverty parent_edu male home_english black hispanic asian other male" 

reghdfe graduate treat_post if sample`m' & n_grade<=1, absorb(cohort#geoid_blkgrp  `controls') cluster(mystd_id)
reghdfe transfer treat_post if sample`m' & n_grade<=1, absorb(cohort#geoid_blkgrp  `controls') cluster(mystd_id)
reghdfe dropout treat_post if sample`m' & n_grade<=1, absorb(cohort#geoid_blkgrp  `controls') cluster(mystd_id)

